<?php

/**
 * This is the model class for table "jumlahjualairminum".
 *
 * The followings are the available columns in table 'jumlahjualairminum':
 * @property integer $jjam_id
 * @property integer $jjam_tahun
 * @property double $jjam_rumah
 * @property double $jjam_pemerintah
 * @property double $jjam_niaga
 * @property double $jjam_sosial
 * @property double $jjam_kran_umum
 * @property double $jjam_industri
 */
class Jumlahjualairminum extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahjualairminum the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahjualairminum';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jjam_tahun', 'numerical', 'integerOnly'=>true),
			array('jjam_rumah, jjam_pemerintah, jjam_niaga, jjam_sosial, jjam_kran_umum, jjam_industri', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jjam_id, jjam_tahun, jjam_rumah, jjam_pemerintah, jjam_niaga, jjam_sosial, jjam_kran_umum, jjam_industri', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jjam_id' => 'Jjam',
			'jjam_tahun' => 'Jjam Tahun',
			'jjam_rumah' => 'Jjam Rumah',
			'jjam_pemerintah' => 'Jjam Pemerintah',
			'jjam_niaga' => 'Jjam Niaga',
			'jjam_sosial' => 'Jjam Sosial',
			'jjam_kran_umum' => 'Jjam Kran Umum',
			'jjam_industri' => 'Jjam Industri',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jjam_id',$this->jjam_id);
		$criteria->compare('jjam_tahun',$this->jjam_tahun);
		$criteria->compare('jjam_rumah',$this->jjam_rumah);
		$criteria->compare('jjam_pemerintah',$this->jjam_pemerintah);
		$criteria->compare('jjam_niaga',$this->jjam_niaga);
		$criteria->compare('jjam_sosial',$this->jjam_sosial);
		$criteria->compare('jjam_kran_umum',$this->jjam_kran_umum);
		$criteria->compare('jjam_industri',$this->jjam_industri);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}